home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_bab_turnerdoor.cog < prev    next >
Text File  |  1999-11-15  |  8KB  |  219 lines

  1. # Jones 3D Cog Script
  2. #
  3. # BAB_Bombfloor.cog
  4. #
  5. # [SXC]
  6. #
  7. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     activate
  14.     message     crossed
  15.    
  16.     thing       player                                  local
  17.     thing       actorindy
  18.     thing       turnerdoor
  19.     thing       turnerkey                               local
  20.     thing       tkeypos
  21.     thing       camera0
  22.     thing       room_tgt
  23.     thing       ext_pos
  24.     thing       ext_pos2
  25.     thing       ext_tgt
  26.     thing       turnerdoorlock
  27.     thing       guard
  28.     thing       metaldoor
  29.     thing       extpos2
  30.  
  31.     surface     fallsurface
  32.     surface     doorsurface
  33.     
  34.     keyframe    in_activate=in_reach_medium.key         local
  35.     template    keytemplate=bronzkeymove                local
  36.     
  37.     sound       gatesqueal=bab_door_metal_slide_c.wav   local
  38.     sound       gatestop=bab_door_metal_stop.wav        local
  39.            
  40.     sound       keyplace=tem_monkeykey_unlock_c.wav      local
  41.     sound       keyunlock=tem_tikikeymove_rotate_c.wav  local
  42.     
  43.     # door locked lines...
  44.     sound        in_key0=Inxj076.wav                        local # This...locked-->in_sayline[18]
  45.     sound        in_key1=Inxj077.wav                        local # It's locked.
  46.     sound        in_key2=Inxj078.wav                        local # Locked.
  47.     sound        in_key3=Inxj082.wav                        local # keyhole here...just need key.
  48.     sound        in_key4=Inxj079.wav                        local # Locked again.
  49.     sound        in_key5=Inxj080.wav                        local # Locked...luck never changes.
  50.     sound        in_key6=Inxj081.wav                        local # Oh no...why...always locked?
  51.                                                         
  52.     # just won't open lines...                          
  53.     sound        in_door0=Inxj096.wav                    local # I can't open it-->insayline[25]
  54.     sound        in_door1=Inxj097.wav                    local # For some reason...won't open.
  55.     sound        in_door2=Inxj098.wav                    local # It won't budge.
  56.     sound        in_door3=Inxj099.wav                    local # Something is holding this door closed.
  57.     sound        in_door4=Inxj102.wav                    local # must be way...don't know how.
  58.                                                         
  59.     sound       indyline4=BB03J04.wav                   local
  60.     
  61.     int         bdone=0                                 local
  62.     int         placechannel                            local
  63.     int         movekeychannel                          local
  64.     int         errorcheck=0                            local
  65.     int         gatechannel                             local
  66.     
  67. end
  68.  
  69. code
  70.  
  71. # ========================================================================================
  72. startup:
  73.  
  74.     player = GetLocalPlayerThing();
  75.     SetThingFlags(actorindy, 0x80000);
  76.     ClearAdjoinFlags(doorsurface, 0x2);                 //nomove
  77.            
  78. return;
  79.  
  80.  
  81. #----------------------------------------------------------------------------------------
  82. crossed:
  83.  
  84.     if (GetSenderRef() == fallsurface)
  85.     {
  86.         DestroyThing(guard);
  87.     }   
  88.     
  89. return;
  90.  
  91. #----------------------------------------------------------------------------------------
  92. activate:
  93.  
  94.     if ((GetSenderRef() == turnerdoorlock) && (GetCurItem(player) == 103) && (bdone == 0))
  95.     {
  96.         bdone=1;
  97.         StartCutscene(1);
  98.         StopThing(player);                      //stop player
  99.         SetActorFlags(player, 0x200000);        //take control away from keyboard
  100.         //DeselectWeaponWait(player);           //deselect weapon and wait for it to finish
  101.         SetThingFlags(player, 0x80000);         //take the player out of the world
  102.         ClearThingFlags(actorindy, 0x80000);    //bring in the stunt indy
  103.         CopyPlayerHolsters(player, actorindy);  //copy the players holsters
  104.         SetCameraFocus(2, camera0);
  105.         SetCameraSecondaryFocus(2, room_tgt);
  106.         SetCurrentCamera(2);
  107.         SetCameraFOV(90, 0, 0);
  108.         PlayKey(actorindy, in_activate, 4, 0x12, 0);
  109.         sleep(0.35);
  110.         turnerkey = CreateThing(keytemplate, tkeypos);
  111.         CaptureThing(turnerkey);
  112.         placechannel=PlaySoundThing(keyplace, turnerkey, 1, 5, 10, 0);
  113.         WaitForSound(placechannel);
  114.         PlaySoundThing(keyunlock, turnerkey, 1, 5, 10, 0);
  115.         Sleep(0.5);
  116.         gatechannel = PlaySoundThing(gatesqueal, turnerdoor, 1, 10, 20, 1);
  117.         SetCollideType(turnerdoor, 0);
  118.         MoveToFrame(turnerdoor, 1, 1);
  119.         AISetLookThing(actorindy, room_tgt);
  120.         WaitForStop(turnerdoor);
  121.         SetCollideType(turnerdoor, 3);
  122.         StopSound(gatechannel, 0);
  123.         PlaySoundThing(gatestop, turnerdoor, 1, 10, 20, 0);
  124.         Sleep(1);
  125.         ChangeInv(player, 103, -1);
  126.         CopyOrientAndPos(actorindy, player);    //copy the actor's pos and orientation onto the player
  127.         SetThingFlags(actorindy, 0x80000);
  128.         ClearThingFlags(player, 0x80000);
  129.         ClearActorFlags(player, 0x200000);
  130.         SetCurrentCamera(1);
  131.         EndCutscene();
  132.         SetAdjoinFlags(doorsurface, 0x2);
  133.         return;
  134.     }
  135.     
  136.     if ((GetSenderRef() == turnerdoor) && (GetCurItem(player) != 103) && (errorcheck == 0) && (bdone == 0))
  137.     {
  138.         StartCutscene(0);
  139.         StopThing(player);
  140.         SetActorFlags(player, 0x200000);
  141.         DeselectWeaponWait(player);
  142.         errorcheck = 1;
  143.         SetExtCamOffset('0.0 -0.18 0.12');
  144.         ##### SetExtCamOffsetToThing(ext_pos);
  145.         PlayVoice(player, in_door0[(RandBetween(0,4))], 1, 1);
  146.         ##### Sleep(1);
  147.         RestoreExtCam();
  148.         errorcheck = 0;
  149.         ClearActorFlags(player, 0x200000);
  150.         EndCutscene();
  151.         return;
  152.     }
  153.     
  154.     if ((GetSenderRef() == turnerdoorlock) && (GetCurItem(player) != 103) && (errorcheck == 0) && (bdone == 0))
  155.     {
  156.         StartCutscene(0);
  157.         StopThing(player);
  158.         SetActorFlags(player, 0x200000);
  159.         DeselectWeaponWait(player);
  160.         errorcheck = 1;
  161.           SetExtCamOffset('0.1 -0.15 0.12');
  162.         #### SetExtCamOffsetToThing(ext_pos);
  163.         PlayVoice(player, in_key0[(RandBetween(0,6))], 1, 1);
  164.         #### Sleep(1);
  165.         RestoreExtCam();
  166.         errorcheck = 0;
  167.         ClearActorFlags(player, 0x200000);
  168.         EndCutscene();
  169.         return;
  170.     }
  171.     
  172.     if (GetSenderRef() == metaldoor && (VectorY(GetThingLVecPYR(metaldoor)) > 50))
  173.     #### if ((GetSenderRef() == metaldoor) && (GetCurFrame(metaldoor) == 0))
  174.     {
  175.         StartCutscene(0);
  176.         StopThing(player);
  177.         SetActorFlags(player, 0x200000);
  178.         errorcheck = 1;
  179.         
  180.         SetExtCamOffset('0.0 -0.18 0.12');
  181.         if (VectorX(GetThingPos(player)) < 1.675)
  182.         {
  183.             if (RandBetween(0, 2) == 0)
  184.             {
  185.                 PlayVoice(player, in_door1, 1, 1);
  186.             }
  187.             else
  188.             {
  189.                 PlayVoice(player, indyline4, 1, 1);
  190.             }
  191.         }
  192.         else
  193.         {
  194.             if (RandBetween(0, 1))
  195.             {
  196.                 PlayVoice(player, in_door1, 1, 1);
  197.             }
  198.             else
  199.             {
  200.                 PlayVoice(player, in_door2, 1, 1);
  201.             }
  202.         }
  203.     
  204.         #### SetExtCamOffsetToThing(ext_pos2);
  205.         #### PlayVoice(player, indyline4, 1, 1);
  206.         #### Sleep(1.5);
  207.  
  208.         RestoreExtCam();    
  209.         errorcheck = 0;
  210.         ClearActorFlags(player, 0x200000);
  211.         EndCutscene();
  212.         return;
  213.     }
  214.     
  215. return;
  216.         
  217. #----------------------------------------------------------------------------------------        
  218.  
  219. end